package net.lzzy.controller;
//
//import net.lzzy.entity.Article;
//import net.lzzy.entity.Comment;
//import net.lzzy.entity.Role;
//import net.lzzy.service.RoleService;
//import net.lzzy.service.UserService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.data.domain.Page;
//import org.springframework.stereotype.Controller;
//import org.springframework.ui.Model;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.PathVariable;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.servlet.ModelAndView;
//
//import java.util.List;
//
//@Controller
//@RequestMapping("/client")
//public class RoleController {
//    @Autowired
//    private RoleService roleService;
//
//    @Autowired
//    private UserService userService;
//
////    @GetMapping("/role")
////    public String role(Model model) {
////        return page(1, model);
////    }
//
//    //分页显示文章
//    @GetMapping("/page/{page}")
//    public String page(@PathVariable("page") int page, Model model) {
//        //分页每页文章数
//        int size = 7;
//        Page<Role> roles = roleService.pageRole(page - 1, size);
//        model.addAttribute("page", page);
//        model.addAttribute("totalPage", roles.getTotalPages());
//        model.addAttribute("articles", roles.getContent());
//        return "client/role";
//    }
//
//
//    @GetMapping("/role")
//    public String roleManager(Model model) {
//        List<Role> roles = roleService.findAll();
//        model.addAttribute("roles", roles);
//        return "/client/role";
//    }
//
//}
